<?php
/*
	用户端公共文件，访问用户端时默认加载
*/
defined('BY_JYA') or exit('error');
cfc('core')->checklogin();

if($_RQ['is_access']){
	//还不是经销商，跳转申请页
	$member=$this->get('member',array('mid'=>$_SESSION['uid'],'merchid'=>$_SESSION['onemerchid']));
	if((!$member['is_agent'] || $member['stop']) && strpos($_RQ['action'],'merch') === false){
		if($_RQ['is_access'] && ($_RQ['onemerchid'] || $_RQ['merchid'])){
			if($_RQ['onemerchid'] || $_RQ['merchid']){
				$_SESSION['onemerchid']=$_RQ['onemerchid']?:$_RQ['merchid'];
			}
			$this->setting=$this->plugin_setting('setting'.$_SESSION['onemerchid']);
		}
		require('actions/apply.php');
		exit;
	}
	
}


